import React from 'react'
import PureRenderMixin from 'react-addons-pure-render-mixin'
import 'static/css/common.less'
import {filter} from 'common/index'
import Enume from 'containers/Wallet/enume'
/**
 * 类别：组件
 * 功能：展示用户余额
 * 示例：分为公司账户和个人账户
 */
class Remainder extends React.Component {
    constructor(props, context) {
        super(props, context);
        this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
    }

    render() {
    	var style={
    		padding	:15,
            textAlign:'center',
            marginBottom:10,
            width:'100%',
            display:'inline-block'
    		// borderBottom	:"1px dashed lightgray"
    	}
        return (
        	<div style={style}>
                <div className="align-center">
                    <div style={{width:'0.7rem',height:'0.7rem'}} className="inline-block">
                        {
                            this.props.balance.acc_type == 208 ? <img src={require('static/image/wallet-company.png')} alt="" /> 
                            : <img src={require('static/image/wallet-person.png')} alt="" /> 
                        }
                    </div>
                </div>
                <div className="padding5">
                    <span >
                        {Enume.accType[this.props.balance.acc_type]}
                    </span>
                </div>
                <div>
                    <strong className="font18">{filter.toMoneyFormat(this.props.balance.balance)}</strong>
                </div>
    			
        	</div>
        )
    }
}

export default Remainder